﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace DaBF.Models
{
    /// <summary>
    /// 站点分类
    /// </summary>
    public class Category:BaseModel
    {
        public int id { get; set; }

        [Required]
        public string CategoryName { get; set; }

        /// <summary>
        /// 父类ID
        /// </summary>
        public int ParentCategoryId { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Order { get; set; }
        /// <summary>
        /// 父类导航属性
        /// </summary>
        [NotMapped]
        public Category ParentCategory { get; set; }
        /// <summary>
        /// 子类列表导航属性
        /// </summary>
        [NotMapped]
        public List<Category> Subcategories { get; set; }
        /// <summary>
        /// 构造函数：初始化子类列表
        /// </summary>
        public Category()
        {
            Subcategories = new List<Category>();
        }
    }
}
